<template>
	<view class="testResult ff-text-center ff-line-height-1-1">
		<view class="testResult-head ff-text-left ff-align-items-1 ff-flex">
			<image src="https://fire-system.oss-cn-beijing.aliyuncs.com/web/fire-technology/test-success.png" mode="">
			</image>
			<view class="ff-color-fff ff-font-18 ff-margin-left-10">
				现场执业已结束
			</view>
		</view>
		<view class="testResult-content ff-bg-fff ff-margin-12 ff-padding-15">
			<view class="testResult-content-tips ff-border-radius-10 ff-padding-10 ff-fo
			
			nt-13 ff-line-height-1-4">
				说明：<br />因检测报告内容填写繁杂，为提高效率，研发网页端，支持填写并提交检测报告、检测档案、上传合同、审批报告等流程。
			</view>
			<img src="https://fire-system.oss-cn-beijing.aliyuncs.com/web/fire-technology/test-process.png" alt="" />
			<img class="test-step"
				src="https://fire-system.oss-cn-beijing.aliyuncs.com/web/fire-technology/test-step.png" alt="" />
			<view class="ff-border-radius-10 ff-padding-15 tipsBpx ff-text-left">
				<view class="ff-flex ff-align-items-1">
					<view class="num">1</view>
					<view class="ff-color-333">使用电脑登录网址：</view>
				</view>
				<view class="ff-margin-left-20 ff-margin-top-5">
					<text>http://smart-fire.zhxfzw.com</text>
				</view>
				<view v-if="false" class="url-but" @click.stop="copeUrl('http://smart-fire.zhxfzw.com')">复制网址
				</view>
			</view>
			<img class="test-step"
				src="https://fire-system.oss-cn-beijing.aliyuncs.com/web/fire-technology/test-step.png" alt="" />
			<view class="ff-border-radius-10 ff-padding-15 tipsBpx ff-text-left">
				<view class="ff-flex ff-align-items-1 ff-line-height-1-4">
					<view class="num">2</view>
					<view class="ff-color-333 ff-flex-1">录入当前账号登录（如果无法登录，请联系平台客服：<text @click="telClick('13375410126')"
							class="ff-color-blue">13375410126</text> ）
					</view>
				</view>
			</view>
			<img class="test-step"
				src="https://fire-system.oss-cn-beijing.aliyuncs.com/web/fire-technology/test-step.png" alt="" />
			<view class="ff-border-radius-10 ff-padding-15 tipsBpx ff-text-left">
				<view class="ff-flex ff-align-items-1">
					<view class="num">3</view>
					<view class="ff-color-333">打开【我的检测】菜单，找到对应项目，</view>
				</view>
				<view class="ff-margin-left-20 ff-margin-top-4 ff-color-333">
					完善相关数据
				</view>
			</view>
		</view>
		<view class="testResult-butList">
			<view><u-button @click="goBackPage" type="primary" shape="circle">返回首页</u-button></view>
		</view>
		<!-- 组件区 -->
		<u-toast ref="uToast" />
		<f-loading ref="loading" />
	</view>
</template>

<script>
	export default {
		name: 'testResult',
		data() {
			return {
				testId: '', // 维保项目的id
				userIds: '', // 当前用户的id
				operators: [], // 执业人员的列表数据
				reportState: false // 是否操作员，可以填写报告书
			};
		},
		onLoad() {
			// console.log('前边页面传过来的数据====', e)
			// this.testId = e.id; // 维保项目的id
			// this.operators = JSON.parse(e.operators); // 执业人员的列表数据
			// this.getUserInfo(); // 获取人员信息列表
		},
		onShow() {
			uni.hideHomeButton(); // 隐藏小房子
		},
		methods: {
			// 拨打电话
			telClick(e) {
				uni.makePhoneCall({
					phoneNumber: e
				});
			},
			// 获取当前用户信息
			async getUserInfo() {
				this.$refs.loading.openLoading('加载中···');
				const data = await this.$http.get({
					url: '/sys/user/info'
				});
				// console.log('获取当前用户信息', data);
				if (data.code == 200) {
					this.userIds = data.data.id;
					let datId = [];
					this.operators.map(res => {
						datId.push(res.projectOperator);
					});
					if (datId.includes(this.userIds)) {
						this.reportState = true;
					} else {
						this.reportState = false;
					}
				}
				this.$refs.loading.closeLoading();
			},
			// 复制网址
			copeUrl(url) {
				console.log(url)
				uni.setClipboardData({
					data: url,
					success: function() {
						uni.showToast({
							title: '复制成功',
							icon: 'success',
							duration: 2000
						});
					},
					fail: (error) => {
						console.log('失败', error);
						uni.showToast({
							title: '复制失败',
							icon: 'none'
						});
					}

				})
			},
			// 返回首页
			goBackPage() {
				this.$pageJump.reLaunch('/pages/detection/mechanism/Maintenance');
			},
		},
		onShareAppMessage() {
			return {
				title: '分享小程序给朋友',
				path: '/pages/homePage/Home'
			};
		}
	};
</script>

<style lang="scss" scoped>
	page {
		background-color: #FAFAFA;
	}

	.testResult {
		padding-bottom: 50rpx;

		&-head {
			background-color: #2979ff;
			padding: 30rpx 0 180rpx;

			image {
				width: 100rpx;
				height: 100rpx;
				margin-left: 30rpx;
			}

			view {}
		}

		&-content {
			border-top-left-radius: 20rpx;
			border-top-right-radius: 20rpx;
			margin-top: -140rpx;

			&-tips {
				text-align: left;
				background-color: #F3F7FF;
				color: #3178FF;
			}

			image {
				width: 100%;
				height: 110rpx;
				margin: 30rpx 0 0;
			}

			.test-step {
				width: 52rpx;
				height: 66rpx;
				margin: 0;
			}

			.tipsBpx {
				background-color: #F3F7FF;
				color: #3178FF;

				.num {
					background-color: #3178FF;
					width: 33rpx;
					height: 33rpx;
					line-height: 33rpx;
					text-align: center;
					border-radius: 50%;
					color: #ffffff;
					font-size: 24rpx;
					margin: 0 10rpx 0 0;
				}

				.url-but {
					background-color: #FFFFFF;
					border-radius: 10rpx;
					width: 100%;
					padding: 20rpx;
					border: 2rpx solid #B5CFFF;
					color: #3178FF;
					margin: 30rpx 0 12rpx;
					text-align: center;

				}
			}
		}

		&-butList {
			width: 88%;
			margin: 100rpx 6% 5%;

			/deep/.u-btn--primary--plain.data-v-3bf2dba7 {
				color: #2979ff !important;
				border-color: #2979ff !important;
				background-color: #fff !important;
			}
		}
	}
</style>
<style>
	page {
		background-color: #fafafa;
	}
</style>